@echo off
echo ====================================
echo     ManageMyself API 启动脚本
echo ====================================
echo.

echo 检查Java环境...
java -version
if %errorlevel% neq 0 (
    echo 错误: 未找到Java环境，请安装Java 11或更高版本
    pause
    exit /b 1
)

echo.
echo 检查Maven环境...
mvn -version
if %errorlevel% neq 0 (
    echo 错误: 未找到Maven环境，请安装Maven
    pause
    exit /b 1
)

echo.
echo 编译项目...
mvn clean compile
if %errorlevel% neq 0 (
    echo 错误: 项目编译失败
    pause
    exit /b 1
)

echo.
echo 启动API服务...
echo 服务地址: http://localhost:8080
echo 健康检查: http://localhost:8080/api/health
echo 数据库状态: http://localhost:8080/api/db-status
echo.
echo 按 Ctrl+C 停止服务
echo.

mvn spring-boot:run 